{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "33d88b32-4026-4bd5-9ad0-2289de5e48b8",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['demo_collection']\n",
      "True\n"
     ]
    }
   ],
   "source": [
    "from pymilvus import MilvusClient\n",
    "import numpy as np\n",
    "\n",
    "import datetime\n",
    "import json\n",
    "\n",
    "\n",
    "def printlog(info):\n",
    "    nowtime = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')\n",
    "    print(\"\\n\"+\"==========\"*8 + \"%s\"%nowtime)\n",
    "    print(str(info)+\"\\n\")\n",
    "    \n",
    "\n",
    "\n",
    "client = MilvusClient(\"../data/milvus.db\")\n",
    "collections=client.list_collections()\n",
    "print(collections)\n",
    "collection=\"demo_collection\"\n",
    "res= client.get_load_state(\n",
    "collection_name=collection\n",
    ")\n",
    "\n",
    "has_collection=client.has_collection(collection_name=collection)\n",
    "print(has_collection)\n",
    "if not has_collection:\n",
    "    printlog(\"create collection {0\".format(collection))\n",
    "    client.create_collection(\n",
    "        collection_name=\"demo_collection\",\n",
    "        dimension=384  # The vectors we will use in this demo has 384 dimensions\n",
    "    )\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "c0d0cb6a-e91f-4448-879e-fe13caf057bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "insert data with length=3\n",
      "\n",
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "inserted data\n",
      "\n",
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "search entity with filter subject == 'history'\n",
      "\n",
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "searched data\n",
      "\n",
      "data: [\"[{'id': 0, 'distance': 0.9999999403953552, 'entity': {'text': 'Artificial intelligence was founded as an academic discipline in 1956.', 'subject': 'history'}}, {'id': 1, 'distance': 0.06355252116918564, 'entity': {'text': 'Alan Turing was the first person to conduct substantial research in AI.', 'subject': 'history'}}, {'id': 2, 'distance': 0.0580061636865139, 'entity': {'text': 'Born in Maida Vale, London, Turing was raised in southern England.', 'subject': 'history'}}]\"] \n",
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "query with filter subject == 'history'\n",
      "\n",
      "data: [] \n",
      "\n",
      "================================================================================2024-09-09 17:15:32\n",
      "queried data\n",
      "\n"
     ]
    }
   ],
   "source": [
    "docs = [\n",
    "    \"Artificial intelligence was founded as an academic discipline in 1956.\",\n",
    "    \"Alan Turing was the first person to conduct substantial research in AI.\",\n",
    "    \"Born in Maida Vale, London, Turing was raised in southern England.\",\n",
    "]\n",
    "\n",
    "vectors = [[ np.random.uniform(-1, 1) for _ in range(384) ] for _ in range(len(docs)) ]\n",
    "data = [ {\"id\": i, \"vector\": vectors[i], \"text\": docs[i], \"subject\": \"history\"} for i in range(len(vectors)) ]\n",
    "\n",
    "\n",
    "printlog(\"{0} data with length={1}\".format('insert', len(vectors)))\n",
    "res = client.insert(\n",
    "    collection_name=\"demo_collection\",\n",
    "    data=data\n",
    ")\n",
    "printlog(\"{0} data\".format('inserted'))\n",
    "\n",
    "printlog(\"{0} entity with filter {1}\".format('search',\"subject == 'history'\"))\n",
    "res = client.search(\n",
    "    collection_name=\"demo_collection\",\n",
    "    data=[vectors[0]],\n",
    "    filter=\"subject == 'history'\",\n",
    "    limit=57,\n",
    "    output_fields=[\"text\", \"subject\"],\n",
    ")\n",
    "printlog(\"{0} data\".format('searched'))\n",
    "print(res)\n",
    "printlog(\"{0} with filter {1}\".format('query',\"subject == 'history'\"))\n",
    "res = client.query(\n",
    "    collection_name=\"demo_collection\",\n",
    "    filter=\"subject == 'academic'\",\n",
    "    output_fields=[\"text\", \"subject\"],\n",
    ")\n",
    "print(res)\n",
    "printlog(\"{0} data\".format('queried'))\n",
    "\n",
    "#client.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "7b246fbf-cc95-4323-a1b5-0047637702f2",
   "metadata": {},
   "outputs": [],
   "source": [
    "client.close()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "97c27b00-8838-43b9-b95e-61a78387e037",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'[{\"id\": 0, \"vector\": [0.652556414667256, -0.4459776881174078, -0.8506546273491578, -0.5377841257699039, -0.6703127224926639, 0.8955754309471666, 0.27467278403228423, -0.5491115649142801, 0.6955591017659235, 0.18584701831783068, 0.9196233330140711, 0.7346123969936968, -0.16220820080417542, -0.5729968752105479, 0.13826735283828606, 0.9501816810358124, -0.892729552451996, 0.27767548561829525, 0.13732823613506517, -0.8990771504331445, -0.38192332497691117, 0.346794515417161, 0.8771888234730361, 0.09665794399473415, -0.7595901138241052, -0.6601448427587477, 0.494040564315571, -0.4076942318396237, -0.005835086871336603, 0.25204419158328495, 0.2881012880504943, -0.9156005983376643, 0.757892058524479, 0.4753750114419457, 0.860353079364734, 0.3765916484051006, 0.08012966083602335, 0.36436935989503105, 0.5564685781437353, 0.5410149563229658, 0.6257020067882539, -0.4529111876698295, -0.5257948126279619, 0.5910599743040157, -0.6305746660308333, -0.09730947813311408, 0.6962183620472471, -0.05079750338309075, -0.2752378773146422, -0.4043093600982335, -0.5838300244204684, 0.945666369177883, 0.04823133472628882, -0.7925674563719658, 0.5751382542253243, -0.8023586794234703, 0.9002327860805364, 0.2786789383397623, 0.3145061310913091, -0.2601837786277972, -0.05239006469554708, 0.8450908902539804, -0.2469976916423564, 0.2078949527565639, -0.8954175782914642, -0.0700285664568907, 0.6755752704005495, 0.6920307557482626, -0.6775535273888511, 0.758538974387529, 0.11701754286516475, -0.6745919032404946, 0.9886528005696598, -0.6320963286356014, -0.9046424788067837, 0.3721071977907153, -0.28173469236354753, 0.03882658647018489, 0.4155819039904405, -0.5958812139610603, -0.6330142219200021, 0.37204864155578865, -0.76103367936396, -0.0761929405568662, -0.543332416948072, -0.4790699780088392, -0.21871822624401505, 0.2446716911287845, 0.21366514324109986, 0.16096666223047218, -0.15433493997983816, 0.8617796410365877, 0.565014140672474, 0.307564930257477, 0.263620336326178, 0.5705293763397552, 0.9161351291933637, -0.09899021839099054, -0.2779516213173745, -0.1826303975573369, 0.7312511541971753, -0.5098305306735069, 0.14186071070956974, -0.3439905366855398, 0.16924795822223282, -0.18993472487217788, 0.24858085753580217, 0.4683241126372919, 0.3458567068729601, 0.10568472095736414, 0.48847165998071396, 0.0457403799415832, -0.3308419124210058, -0.16839158438903157, 0.36286199423280374, 0.111194366285714, -0.5720100750265318, 0.6311346738440842, 0.5323099866089387, -0.3632216366201435, -0.5172286811190465, -0.9999420805873527, -0.6477693615535633, -0.12874469630885765, -0.8463791273124728, -0.9167463046482218, -0.2775236001036212, 0.4917997508143792, -0.9228174481134281, -0.32292861660788774, -0.1383671243454463, -0.7314916476023261, 0.35794116136512955, 0.000343086810754345, 0.24671714939274114, -0.02845929457319918, 0.18479914947627774, 0.5766830394710054, 0.5012003964984408, -0.08964273281021029, 0.828809531230287, 0.35494585263660117, 0.848906323549494, 0.3813660675698629, -0.7354650592648249, -0.7053480542578028, 0.7601917845138846, -0.8521683354558907, 0.29380549230245, -0.12078575092774502, 0.7196272614937578, -0.37209880352912883, 0.10811905873568795, 0.34018648857986244, -0.8618063550150763, -0.08241731577536804, 0.5530015215852284, 0.6793571191787082, -0.8202877273687301, 0.7843501658018373, 0.12380785919231396, 0.21808626135526743, 0.39350790614185804, -0.15042536973933496, 0.7940526881480168, -0.18950485061669986, -0.7194890797430984, 0.6157720711248718, 0.8142486173350993, 0.35205744126600136, 0.6473085898624176, 0.8509867969656455, -0.6968603236792807, -0.03082050013872273, 0.5433021675333716, -0.23628083069597072, 0.2616529816206774, -0.6034773383883074, 0.6899087484017141, -0.5308613550799266, 0.4366278783562523, -0.1324240422658396, -0.768146454304474, 0.7869487157768338, 0.6605853887415281, 0.3320501529304649, 0.31743262453543997, 0.5653248935462754, -0.7357280261781649, 0.9955158471858474, -0.6335090937486649, 0.7513514980489633, -0.37228312249061846, -0.3251871397467674, -0.40567908406428566, -0.9998237927204479, 0.20965144774742495, 0.2657480385567468, 0.7449217967388035, 0.8569683707387252, -0.9639165350102019, 0.993165393514243, 0.8827394447384136, -0.015064151119753344, -0.42684537110552, 0.8153159433796802, 0.6900682486408976, 0.07128248909264356, 0.43144359631051543, 0.8954449589637665, 0.4614968769671275, 0.9711631446628104, -0.1088460394030959, 0.7445969162101416, -0.7986770939202159, -0.8754722124530474, -0.8262591090727309, 0.2864960199428226, -0.09479656538250802, -0.1053921524273298, -0.8506288232704708, 0.584962747116196, -0.830839494085645, 0.36974703877070736, 0.16700641243861392, 0.18777212332906057, 0.6806848162745638, 0.610988676150243, -0.49662564478673143, 0.6631249935234196, -0.09233506270430558, 0.45255698522524157, 0.05580904413721077, -0.9413944270182701, 0.8117595457518021, -0.44441232409927256, 0.3022402634803161, -0.03791712963440519, 0.7301691657234166, 0.4207722995121477, 0.4642380397522001, -0.9950669836730224, 0.1533066098994058, -0.7813596570285606, 0.4498388427510249, -0.17847149417736707, 0.7429612136267458, 0.5262280606786485, 0.45479895216584953, 0.6175125551982168, -0.16108554726862456, -0.5944484923948501, -0.6143716474934329, 0.9545513714001019, 0.27239473957741356, -0.7228257562863574, 0.4997188256001195, 0.7375116203661982, -0.6738399181780859, -0.26528338611084257, -0.6708175132008161, -0.39521127598471173, -0.13026127684786903, -0.3759595364192201, -0.9750903455931625, 0.8630121876432055, -0.3166897763243057, 0.5624892028927588, -0.3255289721166732, -0.5246397544727852, -0.0006808578246340069, 0.7304748529122707, 0.14061843938104013, 0.7694765944366213, -0.40718904377231024, -0.5127526172565999, 0.8909558106919115, 0.515537127878301, 0.5136552133462977, 0.10497243148775759, -0.07663029558898482, 0.7914254183671097, -0.30770542397834677, -0.7168328980607268, -0.7040999121772624, 0.7139247072070032, -0.5785038163979022, 0.20321799885751912, -0.8564824099867334, 0.47661553009719504, -0.17225101790803787, -0.6915002159861094, -0.793206667769581, -0.9625694772866693, -0.13841464848974416, -0.7522637357004127, -0.6697822085955722, -0.6462229074810129, -0.2061618142303152, 0.926050694912051, 0.8216677521024061, -0.814975355830603, -0.6682866050975993, -0.26781150983690205, 0.2200040278889126, 0.3392410295990298, -0.30745807665541913, -0.6345480132401342, -0.9792101600010619, -0.7574977069603115, 0.3302240936445535, -0.04283550008230863, -0.566346669244054, 0.07492181076214566, -0.5747024993139864, 0.6260669019153351, 0.7846103043969097, 0.6709241218777107, 0.6344895213369892, -0.7035742089965704, -0.041636656410638295, -0.855323805237143, 0.21892901300798862, 0.026847241439793113, -0.6176245573692798, 0.14581741176356844, -0.04051764548046943, 0.305107262330111, 0.09545381028278377, -0.10741892567666356, 0.3125014328886533, 0.9390957803453948, 0.02147013579189805, 0.3041981107833027, 0.04827876254837049, 0.6354792774367428, 0.943941757288153, 0.95619030876409, 0.5813710042008846, -0.6560620308369336, -0.006604781834069762, -0.0361870482087332, -0.6704431737594183, 0.37370712201170075, -0.5387397823259605, 0.3992568424999472, 0.153610308735306, -0.6707485754537745, 0.8202642937668043, 0.7000885639401364, 0.49778422969963376, 0.11271028373957748, 0.9500277179537793, -0.5718065764025757, 0.8747563409402992, 0.09819397416292497, -0.6057627904148888, 0.749602094656804, 0.7614106594945071, 0.6308231528627937, 0.8661536561359469, -0.053874146589825145, 0.8918058020018818, -0.9599446869175443, -0.7282362816907773, -0.8778069682544187, 0.6968187831917538, -0.09738038693259554, -0.10680961280521117, 0.10057497532690718, -0.3795143723497143, 0.24298573771902254, 0.8175485488316687, -0.7031984025356521, -0.24683129938561477, -0.8674551534253212, 0.7517804670487247, -0.10211321463200407, 0.10742868139664097, -0.4888264406766003, 0.7912785693507145, 0.7984594503546567, 0.2627876341205688, -0.5623798677880201], \"text\": \"Artificial intelligence was founded as an academic discipline in 1956.\", \"subject\": \"history\"}, {\"id\": 1, \"vector\": [0.6267612301188554, 0.8781381269045094, 0.7014652737335707, 0.46665676448829574, -0.7655841567661328, -0.07641606878084906, 0.30170544894915774, 0.7716922326112414, -0.05317083333676975, 0.9996879542116626, -0.8588541460121286, 0.29824646655549736, 0.3523671061912981, 0.845222326099422, -0.17027420260724058, 0.8688357658506294, -0.6392186878076846, 0.3101413174445389, 0.7523490229395644, -0.4494226940399635, -0.7200376139747326, 0.6854393494353741, 0.6241385633087986, -0.18558548454875878, 0.467554159716826, 0.39825616908094985, 0.9563147015715439, 0.5331666725102191, -0.9116582647170417, 0.672591111153664, 0.090274029176304, 0.8258692548795779, -0.2773371359798611, 0.7865848537877258, -0.12099608546671337, 0.06766774507379547, 0.4206284508049376, -0.24337575230812347, -0.668993197669286, -0.25033217050965506, -0.32613738814848325, -0.9806412604666019, 0.8603840103728357, 0.8788261362560734, -0.2260614252086246, -0.8202407263219054, -0.3026415023125866, -0.30765936903150237, 0.4665348976502981, 0.9754357899317072, 0.20468774162526748, 0.0326943703304412, -0.5413961969214529, 0.885732759214678, 0.5539716875028537, -0.8709563405637282, -0.7656753939574197, 0.37734652772526456, -0.29539483535024447, 0.12091636229278979, 0.06916954749092574, 0.3317411049402921, -0.040653849975619716, -0.7591890717475298, -0.44479610293901795, -0.40694201457041035, 0.5432067648853953, 0.7132771135872131, 0.01738836501078067, -0.7374233150125264, 0.27199355201484376, 0.22448034670367178, 0.3111283418545514, 0.06919241913071472, -0.8783975833538133, -0.5146781670937735, 0.745647878871851, 0.950964361636395, -0.06289000771062803, 0.6388641570027322, -0.08034819521515146, -0.12372077100273882, -0.4594535611549009, 0.16081216424870748, 0.05649613486720528, 0.03894809379379227, -0.7815360454325428, -0.32829387608680727, -0.9724831848186297, 0.3708875377866092, -0.03135283014180579, -0.2875288904815805, -0.7535715160757117, -0.5838423395486569, -0.5899473157079056, -0.8405944668052698, -0.6077736400488569, -0.991196053812573, 0.938447570284177, 0.44032481063130113, -0.7435500901091174, 0.7993123880082169, 0.18385195896744633, -0.7250127386250298, -0.7948284967901516, -0.4960715071981969, 0.6835393608507707, -0.12303228932000154, -0.48553808659196585, 0.36953024263118195, 0.4179967531238564, -0.016675552754548573, -0.6335425205525684, -0.88725088158643, 0.4272135038377858, 0.7856351529319905, 0.48329586375224776, -0.7306951850547119, 0.9341536942651174, 0.3694287690759346, 0.3937658546343994, -0.5728581052633437, 0.8474975687727022, -0.9341400307592731, -0.3042421404086071, -0.9545799156141921, 0.6162587292122368, 0.7827084039970789, -0.20648992023524237, 0.6189559039154324, 0.6362434604502667, 0.5779778306946397, 0.4125878887937322, 0.5456947558091558, -0.6169211695397734, 0.6547281707460224, -0.41196796291697124, 0.45828457276823076, 0.46257460382159943, -0.5662815588704451, -0.8022644094466191, -0.1313140332687257, -0.14856351324977957, 0.2807975482839935, 0.9223441805766714, -0.3943273424194893, -0.634989472013707, -0.3171267940711726, -0.7335256300288511, -0.39426367658020167, 0.22004779994821044, -0.2013656850514849, -0.08742778112410954, -0.3902424204714179, 0.9693664058262339, 0.8555415959361641, -0.40232611484359837, 0.9196298344806282, -0.4486051626200498, 0.3799369817589271, -0.8784132726347442, 0.0340265401575619, 0.28314085874814876, 0.6237041841952704, 0.9084429905757019, -0.18020737970622758, -0.09824833950880763, 0.4894152983832598, 0.302498675575646, -0.9779617843941781, -0.9283437753178614, -0.44595360164708975, -0.5135594076140966, -0.10731036168173502, 0.9125243767091002, -0.7740571810107824, -0.4544755390407187, -0.7750424226433059, 0.24570883148631784, -0.6698653293288674, 0.4390403573109629, -0.2796364144497021, 0.8225626968540392, -0.05561893218352054, 0.04608050785610751, 0.6687823998467346, -0.1271468674924605, 0.855223131961786, 0.4110167906294766, -0.3113941680481671, -0.542277147401562, -0.13960990233650916, 0.05655344717721644, 0.7532082415543113, 0.525919972557136, 0.265319554725274, 0.42678563840389794, 0.05824568414464215, -0.025098217580194593, 0.5460466026037636, 0.24331870809103928, -0.9841618024979166, 0.3913809392049945, 0.904457996438055, -0.3550706589067296, -0.9257888883145431, -0.2684254966761668, 0.5701374571622866, 0.09475817511813323, -0.06469726352826677, 0.11407172107670105, 0.10722514489730584, -0.011648053286186011, 0.34636180797024707, -0.3673376880324992, 0.6200189729922654, 0.1928036839519085, -0.2805692409207461, -0.8988518175258733, 0.5102661822591086, 0.26632101071232794, 0.19236754342253004, -0.07297799404281657, -0.39727788889963667, -0.620654888721248, -0.7711482267800416, 0.4079721111853203, 0.06547078407544293, -0.4522025038282287, 0.14210494041641097, 0.7664919911994805, -0.994246678710569, -0.0599173186313402, 0.8800540082339439, 0.7799035556618479, -0.32248603255748076, -0.002340946450370973, -0.6365019665022837, 0.33156721254747024, 0.8463285036570178, -0.7559349303994192, -0.42703145646034035, -0.24536872362769513, -0.04343987021505291, -0.5712794898922045, 0.2470776924317919, 0.6644837335968323, -0.21875433047495974, -0.008447959701519459, -0.1536198933875883, -0.47230400021565955, 0.09579433200111609, -0.11411446008703963, 0.15970251155428894, -0.013020493267316802, 0.646987665312396, 0.736100397263449, 0.9641951312256183, -0.27739062698456785, 0.2675489206070141, -0.35879953396872644, -0.9943742858799987, -0.572519690101569, -0.7230775965720826, 0.9164798674078336, 0.5543196963143782, 0.22706878066762703, -0.08310346098027988, 0.8745438614332175, -0.5661825160203982, 0.6972851996390741, 0.0030113553255126657, -0.5366358058265479, 0.8171738645121924, 0.07842072805893752, 0.3179341420264863, -0.9048379725508804, 0.8007935523687686, -0.09429617414338853, 0.7825286305635608, -0.535132186206918, -0.8844136116424259, 0.12642946538159094, 0.025938390331800898, 0.7220296683705758, -0.4369823404045292, 0.23186925442879924, -0.5209825410793989, -0.3749551996739089, 0.7765927984504402, -0.6364731308773903, -0.18958518556897697, 0.6578062885937672, 0.11500799715722776, -0.3941720503025248, -0.45009442661544985, -0.26473433949372605, 0.021913459728529094, 0.046358590909911346, -0.1390765642892693, -0.31255137999150406, -0.6598618500589, -0.6477489569984447, -0.27875531625479755, 0.29488880925407135, 0.619255630494504, 0.2686337642605856, 0.1858671614399916, 0.7071376755041385, -0.7149607849489064, -0.570131234160081, -0.5567578318023843, -0.813134287991329, -0.09567790522843111, -0.029306545939671524, 0.18831643040263435, -0.6690728577562628, -0.18350640640125082, 0.9019145805037649, 0.6564115688749825, 0.6393163026705151, 0.3756863727052784, 0.3062598791321396, 0.6342632419069141, -0.5422414357719827, 0.22659508460437738, -0.2163939108082209, -0.3653240736708183, 0.3688558877471897, 0.29745724847792165, 0.28242739913069226, -0.7812101071626161, -0.271142769392958, 0.9164351527031549, -0.3442418445550166, -0.34348835147195067, 0.43694344911225613, 0.3129923217187385, -0.60962264199359, -0.2615901258650457, -0.973483273725881, -0.810688164191709, 0.06090376093898886, -0.4634496876627481, -0.11198328131288382, -0.8111122419348733, 0.2806895551432449, -0.5427685732730891, -0.8486244870820252, -0.5046801006113635, 0.5756760403425141, -0.8332217333287852, -0.07193579315313614, -0.44529899463977385, -0.12489315087328468, 0.8299291207910628, 0.4024238831964515, 0.05355348585188224, 0.5157729454425408, -0.2326700210895336, -0.6532503825546345, -0.37254028353623614, 0.41962322376296224, -0.4351010922025458, -0.6420912415819398, 0.02637220273454899, 0.4116707525241461, -0.22003186580230438, -0.10112535880462326, -0.42272244841913875, -0.5528393883076561, 0.3914450216231964, -0.3450428083799868, 0.9037274248170983, -0.8451477253626385, 0.6019493496926311, -0.346681114677887, 0.589160497476457, -0.3699228525162399, -0.9885796035343111, -0.6710896931196615, 0.5736467104752705, 0.15848902303180123, 0.9460442088147378], \"text\": \"Alan Turing was the first person to conduct substantial research in AI.\", \"subject\": \"history\"}, {\"id\": 2, \"vector\": [-0.030355993086004007, -0.6611507995490125, -0.5488911541299264, 0.585168259173527, 0.8670176984731082, -0.762331089095921, 0.22155081743101612, -0.897526180405027, 0.08081174465310736, -0.4675642028912852, -0.5689593770047021, -0.6298645915723033, 0.5302085186505041, 0.020358340468235703, -0.6744124456068308, 0.106823545871233, 0.21746197302838133, 0.23377259059604905, 0.19724656044293454, -0.46288964916371333, -0.8612237997449756, -0.17538796589414707, 0.8062519211627432, 0.23851681526376844, -0.05325104364156941, -0.9176927362599261, -0.808068920216638, -0.6629684876425304, -0.9054774093908602, 0.9752951815194355, -0.6373996582537464, -0.6978251829226458, -0.1178592683118529, 0.5835092200639265, 0.25024773123249844, -0.17033107826570792, 0.7426459971146424, -0.9302460829295807, -0.07967681122086345, -0.9684719776063251, 0.9278715939767901, 0.8405771404070785, -0.28225418846973427, 0.5414180319821984, 0.6491039632975468, 0.8296220203719518, -0.7384726794513357, -0.5003353607874352, 0.23725451113724594, -0.43780482821484146, 0.226234306388295, -0.3766688257916031, -0.1417767899516995, 0.06828334071141762, 0.9344056372240339, 0.2761359190703476, -0.5407867667103474, -0.8909715313215012, 0.8074501946637336, -0.6878585935628685, 0.6342830764844938, -0.15928677507859978, 0.22084245194766816, 0.3393917122490211, 0.774019265475014, 0.40487254522406424, 0.8017844143205777, -0.8529974712954886, 0.9235554849717853, -0.06466756818856045, 0.11668183557618161, 0.43787559243239116, 0.2708239247002273, 0.9073981695518325, 0.301819433289807, -0.2756268281578169, 0.7029893814961816, -0.1473905833135476, -0.324115668241304, -0.5963193161039662, 0.08726672186511109, 0.6090690894458328, 0.8337742263862495, -0.42409056876202444, 0.9270772138528278, 0.8096387014946991, 0.23282317500980332, -0.5013833848122744, 0.22372927392590136, 0.8845566396620481, 0.48377767837184615, 0.466419784162615, -0.6657253382499715, 0.44879594450394733, -0.5217169628404981, 0.9047863381499213, -0.03514430771441934, 0.004183311072907925, -0.05854792053123403, -0.29189414721542106, -0.9441684508647772, -0.6699553278738954, 0.9747024183605819, -0.44322584729561787, 0.8914427786117933, 0.7718631367041291, 0.6456998736988331, -0.049596489222949236, 0.8612849463171608, -0.010420467993134341, 0.7833538266399842, 0.1997068834952469, 0.45280667281969444, 0.49405052349720635, 0.09448060723421059, 0.008148213135565463, 0.6237523651022845, -0.80901672872377, -0.01971930053958415, -0.9352226450853118, 0.7189248394446917, 0.5527367226462219, -0.9053435000320513, 0.06959213911072837, 0.07379160907966398, 0.06574875018525161, -0.5064379296838437, -0.7596162931680894, 0.5795770542406133, 0.6422881723884184, 0.12756726181226496, 0.2869396313038568, 0.7147051495677821, 0.9304881421363154, -0.9845637821785349, -0.810631358503805, -0.32732521229312206, 0.9137394573518687, 0.3644434234475036, 0.4739381841780417, -0.3957878974083968, 0.392186156706414, -0.01383983855194093, 0.42851509760486794, -0.8906913948132895, -0.5408504692149048, -0.8904474044401629, 0.7495019374465715, 0.5795103082247666, 0.8380532472276092, 0.09040335331487115, -0.23001193797915165, 0.8221335029571322, -0.972894327857815, 0.805531595374618, 0.03970715456725449, -0.2834201922455175, -0.9415740298409772, -0.1719752082109649, -0.7441169712572699, 0.5205445857434119, 0.2257002806095858, 0.41069980061491007, 0.389253900967764, -0.45142853671775973, 0.3038607380668892, 0.37977010162191505, 0.42359381565007914, 0.6242249377444782, 0.7555019723688721, -0.3973044073225782, 0.11634668343162291, -0.4671857072275669, -0.25434107729284317, -0.7343577453423689, 0.36101456939859733, -0.2542582002712308, 0.8241168107874863, -0.6033820555863461, -0.904219767174816, -0.26211349156315933, -0.10335741558946854, -0.6625802894260349, -0.9172972375654069, 0.6079084101978012, -0.10092733059783043, -0.7702819945803636, -0.5711230204806212, -0.6485719226693933, 0.9251052974020673, -0.18024276330952715, 0.8123906791248767, 0.939433657444525, 0.1344071400195963, 0.23220064612479852, -0.6618434046496864, 0.11727362700902133, 0.9305270989121037, 0.5409616255762988, 0.3331554255017086, 0.7156128449168466, 0.7980692140144727, 0.5098664097654089, 0.9182951886045796, -0.3176352598926191, 0.5197578470834945, 0.7919081670484536, -0.9112588960980244, -0.6995818125372539, -0.642851815230296, 0.20925784464885555, 0.685485138722191, 0.31349028523788003, 0.5615195926836658, -0.23479268908359363, 0.7844261719283638, 0.5734218133959117, 0.6902748437847783, -0.06648354463274875, -0.014871658212540773, 0.6241630629220771, 0.7754715930517608, -0.7558614703519992, 0.6707541104957546, -0.6668905127152145, -0.0381701966785597, 0.49696825305993975, -0.4019843193274586, -0.5506797983856748, -0.3686213486013503, -0.5495459448531193, 0.684186517999531, -0.059936479560329436, -0.48422476759975863, 0.27582357568861093, -0.7802570905139745, -0.9721452838271352, -0.8343809078879427, 0.4242564883651514, -0.2515462121144294, -0.3780115279314633, 0.9502421727201948, 0.8328669119878549, 0.6732713604233536, -0.15142595117940139, -0.8233563373980974, -0.4590551361855886, -0.9208429192376073, -0.9988928832886523, 0.4817829981524673, 0.4348303290885076, -0.30790365375751794, 0.38719670119040517, 0.8586672105291251, 0.7754104451350956, 0.40798852631518656, 0.9315525578380401, -0.2107385678132041, -0.8781083534621805, 0.6415019093020449, 0.6206942568224814, -0.7421466493336679, -0.7002806518420872, -0.7137354568577365, 0.4634270774229823, -0.36165368779241147, 0.0973844014484524, -0.29326878156990177, -0.8737976028979773, -0.8296274848874314, -0.31142130205494944, -0.6403984523608655, 0.2838198822789282, 0.4491746543319326, 0.3936972538461989, 0.8516241743878745, 0.5129892189954661, 0.8363711439286705, 0.5575468988875731, 0.23229792190917764, 0.7726764254218093, 0.33879292740773215, 0.42579283264193557, 0.4412159589988873, 0.843590485735136, -0.5685050493954031, 0.8129722344742429, 0.7618318762292597, -0.21102512796106843, 0.5377428721747011, -0.28951833088998846, 0.7361829349172688, -0.690061655298579, -0.8937875931475037, -0.990698788969844, -0.624355238261892, 0.7302843200391822, 0.9215319417851529, -0.07930769361646584, -0.876983557922798, 0.943429989266283, -0.8767298381629116, -0.8211212473037559, 0.7532628511800712, -0.5232154694509881, -0.5335840438406974, 0.8309118655909593, 0.1394713840473918, -0.2818526602508473, 0.1404000617031238, -0.24580986324022813, -0.9992418192920094, -0.4579968721289407, 0.618615936528266, 0.19861019037620542, -0.23654608481154393, -0.18176732458810885, 0.8029084196291696, 0.9998076496722481, 0.1237079179029108, 0.8044893333666185, -0.6110352570009663, 0.41459899714071735, -0.47079015908830146, -0.3870957936143311, -0.9710197102217848, 0.910698802776881, -0.09644091270157906, 0.5706737430708151, -0.8871743211835557, 0.10621874696232214, -0.6590401848507677, -0.42562897899333074, 0.9641782835890067, 0.6489923803087165, 0.5191897277880404, 0.8970316933493261, -0.8422469270724153, 0.5702856594793131, 0.4048318093201224, -0.7661653563089739, -0.5361828099005219, 0.6461790834160919, 0.9489221822221678, 0.7134303925932584, 0.8030520809907613, -0.2343510804775606, -0.8251975659570665, 0.929304496279298, 0.7209457902353451, 0.3086700952492263, -0.3075743859953395, 0.916705433449954, -0.4399978719555082, 0.4794687284108914, -0.5180427031649659, 0.5052294733741745, -0.15073589723967884, -0.6672813816759664, -0.4294598709424673, 0.4673026221577723, -0.29791336351006903, 0.4829716306576093, -0.8992229760997286, 0.33717174181526466, 0.5145234158216463, 0.4467892738352026, -0.3508683533626258, -0.40966987388794185, 0.1857564415166335, 0.12129299975020769, 0.47775329409545164, 0.9088289077933025, 0.32201695993946733, -0.7315583078106562, -0.8196047322898055, -0.4686304508631036, 0.6215711419113623, 0.9876359725253232, 0.26606408628867784, 0.23291333557988025, -0.3394096105393287, -0.8909319269900886, -0.2661451578501419], \"text\": \"Born in Maida Vale, London, Turing was raised in southern England.\", \"subject\": \"history\"}]'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import json\n",
    "json.dumps(data)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3e2569c0-92ff-48a0-b53a-4ec30a19acb4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
